from django.contrib import admin
from models import *

class CategoryAdmin(admin.ModelAdmin):
    list_display = ('name', 'order', 'art_count')
    ordering = ['order']

admin.site.register(Category, CategoryAdmin)


class ArticleAdmin(admin.ModelAdmin):
    list_display = ('title', 'category', 'post_time', 'view_count')
    ordering = ['-post_time']
    search_fields = ('title', 'summary', 'content')
    
admin.site.register(Article, ArticleAdmin)


class CommentAdmin(admin.ModelAdmin):
    list_display = ('name', 'content', 'post_time', 'article')
    ordering = ['-post_time']
    search_fields = ('name', 'content')
    
admin.site.register(Comment, CommentAdmin)